<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="../css/dingdanjiesuan.css">
    <link rel="stylesheet" href="http://at.alicdn.com/t/font_1341521_yvtami4tmb.css">
    <title>Document</title>
</head>
<body>
    <header>
        <span class="iconfont icon-fan_hui"></span>
        <p>订单结算</p>
    </header>
    <main>
        <div id="address">
            <span><img src="../image/dingdanjiesuan-01.png" alt=""></span>
            <a href="./我的易果小页面/add_address.html">
            <p>添加收货地址</p></a>
        </div>
        <div id="goods">
            <div id="num">
                <p>共<span></span>件商品</p>
            </div>
            <div id="pic">
                <ul>
                    <!-- <li><img src="../image/fenlei-1.png" alt=""></li>
                    <li><img src="../image/fenlei-2.png" alt=""></li>
                    <li><img src="../image/fenlei-3.png" alt=""></li>
                    <li><img src="../image/fenlei-4.png" alt=""></li> -->
                </ul>
            </div>
        </div>
        <div id="date">
            <div id="riqi"><span>配送日期</span><p>收货地址不支持配送<span class="iconfont icon-huise"></span></p></div>
            <div id="fapiao"><span>发票信息</span><p>不需要发票<span class="iconfont icon-huise"></span></p>
            </div>
            <div id="liuyan"><span>留言:</span><input type="text" placeholder="如有特殊要求，请在此留言"></div>
        </div>
        <div id="youhuiquan">
            <span>优惠券</span>
            <span id="number">3</span>
            <span class="iconfont icon-huise"></span>
        </div>
        <div id="total">
            <p><span>商品合计</span><span>￥209.6</span></p>
            <p><span>运费</span><span>￥209.6</span></p>
            <p><span>活动优惠</span><span>￥209.6</span></p>
            <p><span>应付金额</span><span>￥209.6</span></p>
        </div>
    </main>
    <footer>
        <div id="money">
            <span>应付金额:</span>
            <span>￥</span>
            <span>169.70</span>
        </div>
        <div id="gopay">结算</div>
    </footer>
    <script src="../js/rem.js"></script>
    <script src="../js/jquery-1.11.3.min.js"></script>
    <script src="../js/axios.min.js"></script>
    <script src="../js/api.js"></script>
    <script>
        let goBack = document.querySelector(".icon-fan_hui");
        goBack.onclick = function(){
            location.href = "购物车.html";
        }
        // 根据用户id显示商品
        axios.get(cart_cartShow_Api, {
            params: {
                id
            }
        }).then(res => {
            console.log(res.data);
            let html = res.data.map(v =>
                `
                <li><img src="../image/fenlei-1.png" alt=""></li>
                `
            ).join("");
            let pic = document.querySelector("#pic ul");
            pic.innerHTML = html;
            let num = document.querySelector("#num p span")
            num.innerHTML = res.data.length;
        })
    </script>
    <script>
        // let actuallyPaid = ;
        // let address = ;
        // let deliveryDate=;
         $("#gopay").click(function(){
             //点击结算生成订单（添加订单接口）
            $.post( add_list_Api,{userId:id,goodsId:1,price:2},function(res){
                console.log(res.data);
            })

         })
    </script>
</body>
</html>